//
//  SDDetectionFooter.m
//  skinDetection
//
//  Created by  liangzhun on 2018/11/1.
//  Copyright © 2018年  liangzhun. All rights reserved.
//

#import "SDDetectionFooter.h"

@implementation SDDetectionFooter

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (void)setTypeBtn
{
    self.SSLead.constant = self.MGDLead.constant = self.MKLead.constant = (SDMainScreenWidth - 250 - 30)/4.0;
  
    NSArray *selectedArray = @[@"干纹",@"色素1",@"敏感度1",@"毛孔",@"粉刺1"];
    NSArray *normalArray = @[@"干纹2",@"色素",@"敏感度",@"毛孔2",@"粉刺"];
    
    for (int b = 0; b < self.skinBtnArray.count; b++) {
        
        UIButton *typeBtn = self.skinBtnArray[b];
        [typeBtn.layer setBorderColor:SDMainColor.CGColor];
        [typeBtn.layer setCornerRadius:5];
        [typeBtn.layer setMasksToBounds:YES];
        
        [typeBtn setTitleColor:SDMainTextColor  forState:UIControlStateNormal];
        [typeBtn setTitleColor:SDMainColor forState:UIControlStateSelected];
        
        [typeBtn setImage:[UIImage imageNamed:normalArray[b]] forState:UIControlStateNormal];
        [typeBtn setImage:[UIImage imageNamed:selectedArray[b]] forState:UIControlStateSelected];
        
       
    }
    
}

-(void)setSelectBtn:(UIButton *)selectBtn
{
    _selectBtn.selected = NO;
    [_selectBtn.layer setBorderWidth:0];
   
    _selectBtn = selectBtn;
    _selectBtn.selected = YES;
    [_selectBtn.layer setBorderWidth:1];
    
}
@end
